package com.baiwei.vpnapi.dao;

import com.baiwei.vpnapi.entity.VpnConnection;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface VpnConnectionMapper extends BaseMapper<VpnConnection> {
    /**
    * @Description: 查询用户占用的非免费连接数量
    * @Param: 
    * @return: 
    * @Author: Mr.Stone
    * @Date: 2020/3/20
    */
    @Select("select count(connect_id) from connection where user_id = (#{userId}) and status = 1 and isfree = 0")
    public Integer getConnectCount(Integer userId);
}
